export function deepTree(list){
    const map = {};
    const result = [];
    list.foreach((item)=>{
        map[item.id] = {...item}
    });
    list.forEach((item)=>{
        if(!item.parentId){
            result.push(map[item.id]);
        } else {
            const parent = map[item.parentId]
        } if(parent.children){
            parent.children.push(map[item.id])
        } else {
            parent.children = [map[item.id]]
        }
    })

    return result;
}